package com.igoal.dao;

import java.util.List;

import com.igoal.entity.User;
import com.igoal.entity.UserFriend;

/**
 * DAO for {@link UserFriend} entity
 * 
 * @author Tri
 * @since 6/4/2010
 */
public interface UserFriendDAO extends GenericDao<UserFriend, Long> {
	
	/**
	 * Get 5 random friends
	 * 
	 * @param owner
	 * @param accepted
	 * @return
	 */
	List<UserFriend> listRandomFriends(User owner, Boolean accepted);

	/**
	 * Get all user's friends
	 * 
	 * @param owner
	 * @param accepted
	 * @return
	 */
	List<UserFriend> listAllFriends(User owner, Boolean accepted);

	List<UserFriend> listFriends(User owner, int pageId);

	boolean isFriend(User user1, User user2);

	UserFriend findByFromTo(User from, User to);
	
	int countFriends(User owner, Boolean accepted);
	
	boolean exists(User from, User to);
	
	List<UserFriend> listPotentialFriends(User owner, int limit);
}
